package cn.itcast.service.impl;

import cn.itcast.dao.AddressDao;
import cn.itcast.pojo.Address;
import cn.itcast.service.AddressService;
import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
public class AddressServiceImpl implements AddressService {


    @Autowired
    private AddressDao addressDao;

    //查询所有分院
    @Override
    public List<Address> findAll() {


        List<Address> list= addressDao.findAll();


        return list;
    }

    //根据id查询分院
    @Override
    public Address findAddressById(Integer id) {
        Address address= addressDao.findAddressById(id);

        return address;
    }

    //添加分院
    @Override
    public void addAddress(Address address) {
        addressDao.addAddress(address);
    }

    //修改分院
    @Override
    public void updateAddress(Address address) {
        addressDao.updateAddress(address);
    }


    //删除分院
    @Override
    public void deleteAddress(Integer id) {
        addressDao.deleteAddress(id);
    }

    //启用禁用
    @Override
    public void updateAddressByeid(Integer id, Integer eid) {
        addressDao.updateAddressByeid(id,eid);

    }
}
